# vim:filetype=make
# make.config
# written by Jonas Juselius <jonas@iki.fi> Tue Dec  4 12:09:26 EET 2001
#



SHELL:=/bin/sh

host:=x86_64-unknown-linux-gnu
host_os:=linux-gnu
host_cpu:=x86_64
host_vendor:=unknown


PACKAGE_NAME:=CCSO
PACKAGE_TARNAME:=ccso
PACKAGE_BUGREPORT:=404227815@qq.com, wangf44@gmail.com
PACKAGE_VERSION:=1.0
ARCHIVE_NAME=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
ARCHIVE_TARNAME=$(PACKAGE_TARNAME)_$(PACKAGE_VERSION)

CC:=gcc
CXX:=g++
FC:=h5fc -acc -cuda -gpu=cuda11.0
CPP:=gcc -E
CPPFLAGS:=
CFLAGS:=
CXXFLAGS:=
FCFLAGS:= -fopenmp
LDFLAGS:=  
LIBS:=

LD:=ld
RAN:=ranlib
STRIP:=strip
AWK:=@AWK@
AR:=ar
ETAGS:=true
CTAGS:=ctags
LN_S:=@LN_S@
YACC:=@YACC@
LEX:=@LEX@
LEXLIB:=@LEXLIB@
PYTHON_BIN=@PYTHON_BIN@
PYTHON_LIB=@PYTHON_LIB@

FORTRAN_COMPILER=h5fc -acc -cuda -gpu=cuda11.0

INSTALL:=/usr/bin/install -c
INSTALL_DATA:=${INSTALL} -m 644
INSTALL_SCRIPT:=${INSTALL}
INSTALL_PROGRAM:=${INSTALL}
mkinstalldirs=$(topdir)/config/mkinstalldirs

FC_MODEXT=
FC_MODCASE=@FC_MODCASE@

prefix=/usr/local/ccso
exec_prefix=${prefix}
inst_bindir=${exec_prefix}/bin
inst_libdir=${exec_prefix}/lib
inst_libexecdir=${exec_prefix}/libexec
inst_includedir=${prefix}/include
inst_datadir=${datarootdir}

ifeq ($(patsubst /%,,.),)
  topdir:=.
else
  topdir:=$(builddir)/.
endif
srcdir:=$(topdir)/$(notdir $(shell pwd))
libdir:=$(builddir)/lib
libexecdir:=@top_libexecdir@
bindir:=$(builddir)/bin
scriptdir:=$(builddir)/bin
includedir:=$(topdir)/include
datadir:=$(builddir)/share
datarootdir=${prefix}/share

ARCH=x86_64-unknown-linux-gnu

FCLIBS= -L/home/wangzf/nvidia/Linux_x86_64/20.7/math_libs/11.0/lib64 -L/home/wangzf/nvidia/Linux_x86_64/20.7/cuda/11.0/lib64 -L/home/wangzf/hdf5/lib -L/home/wangzf/nvidia/Linux_x86_64/20.7/compilers/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/8 /home/wangzf/hdf5/lib/libhdf5hl_fortran.a /home/wangzf/hdf5/lib/libhdf5_hl.a /home/wangzf/hdf5/lib/libhdf5_fortran.a /home/wangzf/hdf5/lib/libhdf5.a -lz -ldl -lm -L/usr/lib/gcc/x86_64-redhat-linux/8/../../../../lib64 -lcudafor101 -lcudafor -lcudaforblas101 -lacchost -lacccuda -lcudadevrt -lcudart -lcudadevice -lcudafor2 -lnvf -lnvomp -lnvhpcatm -lpthread -lnvcpumath -lnsnvc -lnvc -lrt

BLAS_LIBS=-L/home/wangzf/intel/compilers_and_libraries_2020.2.254/linux/mkl/lib/intel64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl 
LAPACK_LIBS= $(BLAS_LIBS)

BLAS95=@F90_LIBS_blas95@
LAPACK95=@F90_LIBS_lapack95@
LIBMPI_F90=@F90_LIBS_mpi_f90@
MPI_TYPE=none
ENABLE_GIMIC=no

#Fortran flags
fcflags:=-Minfo=accel -mp -O2 -fast -DINT64 -Mpreprocess -i8 -Mextend -mcmodel=medium -Mlarge_arrays
fdebug:=-g -DINT64 -Mpreprocess -i8 -Mextend -mcmodel=medium -Mlarge_arrays
fprof:=-pg
frange:=-C
fldflags:=-O2 -i8 -fast -mcmodel=medium -Mlarge_arrays

# C compiler flags
cflags:=-O2 -std=c99 -DINT64
cdebug:=-g -std=c99 -O0 -DINT64
cprof:=-DPROFILE
crange:=
cldflags:=-O2 -std=c99

# C++ compiler flags
cxxflags:=-O2 -Drestrict=__restrict__ -DINT64 -fopenmp
cxxdebug:=-g -O0 -Drestrict= -DINT64
cxxprof:=-DPROFILE
cxxrange:=
cxxldflags:=-O2 -fopenmp

ifdef DEBUG
  fcflags:=$(fdebug) 
  cflags:=$(cdebug) 
  cxxflags:=$(cxxdebug) 
  bindir:=.
endif

fcflags+=-I.. -I$(includedir) 
cflags+=-I.. -I$(includedir) 
cxxflags+=-I.. -I$(includedir) 

ifdef PROF
  fcflags+=$(fprof)
  fldflags+=$(fprof)
  cflags+=$(cprof)
  cldflags+=$(cprof)
  cxxflags+=$(cxxprof)
  cxxldflags+=$(cxxprof)
  bindir:=.
endif

ifdef RANGE
  fcflags+=$(frange)
  cflags+=$(crange)
  cxxflags+=$(cxxrange)
  bindir:=.
endif

fldflags:=$(fldflags) -L. -L$(libdir) $(LDFLAGS)
cldflags:=$(cldflags) -L. -L$(libdir) $(LDFLAGS)
cxxldflags:=$(cxxldflags) -L. -L$(libdir) $(LDFLAGS)

# remove extra whitespace
FCFLAGS:=$(strip  $(fcflags))
FLDFLAGS:=$(strip $(fldflags))

CFLAGS:=$(strip   $(cflags))
CLDFLAGS:=$(strip $(cldflags))

CXXFLAGS:=$(strip   $(cxxflags))
CXXLDFLAGS:=$(strip $(cxxldflags))

